<template>
	<view>
		<view class="home-tbody-list backgroundColor">
		    <view class="tbody-list-null" v-if="listData.length == 0">暂无用户发帖</view>
		    <Invitation :Article.sync="listData" :show="true" :nowSite="popularSite" v-if="listData.length > 0"></Invitation>
		</view>
	</view>
</template>

<script>
	import Invitation from "../../components/invitationItems/invitation";
	export default {
		data() {
			return {
				listData:[],
				pageNum:1,
				limit:10,
				popularSite:''
			};
		},
		components: {Invitation},
		methods:{
			async getMyBrowseHistory(){
				let params={
					user_token:uni.getStorageSync('userToken'),
					limit:this.limit,
					page:this.pageNum
				}
				
				let res=await this.$api.getMyBrowseHistory(params);
				if(res.data.level=='success'){
					this.listData=[...this.listData,...res.data.data]
				}
			}
		},
		onLoad() {
			this.getMyBrowseHistory()
		},
		onPageScroll(e){
			this.popularSite = e.scrollTop;
		},
		onReachBottom() {
			this.pageNum++;
			this.getMyBrowseHistory()
		}
	}
</script>

<style lang="scss">

</style>
